public class TimeConvert
{
   /**
      Converts military time to ordinary time.
      @param milTime, the military time provided: hhmm
      @return a string of the form 9:35 am or 7 pm
   */
   public static String militaryToOrdinaryTime(int milTime)
   {
      int t,x;
      t=milTime/100;
      x=milTime%100;
      String ss ="";
      if(t<12&&t!=0){
         if(x<10)
         ss = t+":"+"0"+x+ " am";
         else
         ss = t+":"+x+" am";
      }
      else if(t>12){
         t-=12;
         if(x==0)
         ss = t+ " pm";
         else
         ss = t+":"+x+" pm";
      }
      else if(t==0)
      ss = "12"+":"+x+" am";
      return ss;
   }
}